package cn.youyeku.zsxh.ui.teacher;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

import cn.youyeku.zsxh.R;
import cn.youyeku.zsxh.bean.Question;
import cn.youyeku.zsxh.ui.activity.ABS.BaseActivity;

/**
 * Created by youye on 17-4-18.
 */

public class GraphicQuestionShowChat extends BaseActivity implements View.OnClickListener {

    private TextView mCheckDesc;
    private RadioButton mCheckA;
    private RadioButton mCheckB;
    private RadioButton mCheckC;
    private RadioButton mCheckD;
    private RadioGroup mCheckGroup;
    private TextView mParse;
    /**
     * 上一题目
     */
    private Button mCheckFront;
    /**
     * 编写下一题目
     */
    private Button mCheckNext;
    /**
     * 提交并查看结果
     */
    private Button mCheckResult;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_do_question);
        initView();
        Question question = (Question) getIntent().getSerializableExtra("data");
        setQuestionData(question);
        mCheckResult.setVisibility(View.GONE);
        mCheckNext.setVisibility(View.GONE);
        mCheckFront.setVisibility(View.GONE);


    }

    private void initView() {
        mCheckDesc = (TextView) findViewById(R.id.check_desc);
        mCheckA = (RadioButton) findViewById(R.id.check_a);
        mCheckB = (RadioButton) findViewById(R.id.check_b);
        mCheckC = (RadioButton) findViewById(R.id.check_c);
        mCheckD = (RadioButton) findViewById(R.id.check_d);
        mCheckGroup = (RadioGroup) findViewById(R.id.check_group);
        mParse = (TextView) findViewById(R.id.parse);
        mCheckFront = (Button) findViewById(R.id.check_front);
        mCheckFront.setOnClickListener(this);
        mCheckNext = (Button) findViewById(R.id.check_next);
        mCheckNext.setOnClickListener(this);
        mCheckResult = (Button) findViewById(R.id.check_result);
        mCheckResult.setOnClickListener(this);
    }
    private void setQuestionData(Question question) {
        mCheckA.setText(question.getOp_a());
        mCheckB.setText(question.getOp_b());
        mCheckC.setText(question.getOp_c());
        mCheckD.setText(question.getOp_d());
        mCheckDesc.setText(question.getDesc());
        mParse.setText("正确答案:" + question.getAnwser() + "  " + question.getAnswer_parse());


    }
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.check_front:
                break;
            case R.id.check_next:
                break;
            case R.id.check_result:
                break;
        }
    }
}
